import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',//前端默认路径
      name: 'login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/shouye',
      name: 'shouye',
      component: () => import('../views/ShouYeView.vue'),
      children: [
        {
          path: '/adminsetting', //管理员设置
          name: 'adminsetting',
          component: () => import('../views/BasicData/AdminSettingView.vue'),
        }, {
          path: '/gridperson',//网格人员管理
          name: 'gridperson',
          component: () => import('../views/BasicData/GridPersonSetting.vue'),
        }, {
          path: '/log',//日志列表
          name: 'log',
          component: () => import('../views/BasicData/LogView.vue'),
        }, {
          path: '/physicalgrid',//物理网格
          name: 'physicalgrid',
          component: () => import('../views/GridManage/PhysicalGridView.vue')
        }, {
          path: '/wuli',//物理网格
          name: 'wuli',
          component: () => import('../views/GridManage/WuliView.vue')
        }, {
          path: '/logical',//逻辑网格
          name: 'logical',
          component: () => import('../views/GridManage/LogicalView.vue')
        }
      ]
    }, ,
    {
      path: '/MyIndex',
      name: 'MyIndex',
      component: () => import('../views/MyIndexView.vue'),
      children: [

      ]
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      // children: [
      //   {
      //     path: '/adminsetting', //管理员设置
      //     name: 'adminsetting',
      //     component: () => import('../views/BasicData/AdminSettingView.vue'),
      //   }, {
      //     path: '/gridperson',//网格人员管理
      //     name: 'gridperson',
      //     component: () => import('../views/BasicData/GridPersonSetting.vue'),
      //   }, {
      //     path: '/log',//日志列表
      //     name: 'log',
      //     component: () => import('../views/BasicData/LogView.vue'),
      //   }, {
      //     path: '/physicalgrid',//物理网格
      //     name: 'physicalgrid',
      //     component: () => import('../views/GridManage/PhysicalGridView.vue')
      //   }
      // ]
    }, {
      path: '/main',
      name: 'main',
      component: () => import('../views/MainView.vue'),
      children: [

      ]

    },

    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
